package com.example.ephuizi.stl;

import android.app.Activity;
import android.content.Intent;
import android.graphics.Color;
import android.graphics.Typeface;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.TextView;

import com.example.ephuizi.stl.activity.OpenGL20Activity;
import com.example.ephuizi.stl.util.photo_3d.SealImage;


public class STLActivity extends Activity implements View.OnClickListener {

    private TextView sealTv;
    private TextView usbShellTv;
    private TextView backgrounbTv;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        //全屏设置
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
        //标题是属于View的，所以窗口的所有修饰部分隐藏
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        setContentView(R.layout.activity_main);
        sealTv = (TextView) findViewById(R.id.stl_seal_tv);
        usbShellTv = (TextView) findViewById(R.id.stl_usb_shell_tv);
        backgrounbTv = (TextView) findViewById(R.id.stl_background_tv);
        sealTv.setOnClickListener(this);
        usbShellTv.setOnClickListener(this);
        backgrounbTv.setOnClickListener(this);
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
//        getMenuInflater().inflate(R.menu.main, menu);
        return true;
    }

    /**
     * Called when a view has been clicked.
     *
     * @param v The view that was clicked.
     */
    @Override
    public void onClick(View v) {
        String path = "HUI";
        switch (v.getId()) {
            case R.id.stl_seal_tv:
                path = "/sdcard/hui/test.stl";
                break;
            case R.id.stl_usb_shell_tv:
                path = "USB";
                break;
            case R.id.stl_background_tv:
                path = "/sdcard/hui/test.png";
                break;

        }
        Intent intent = new Intent(STLActivity.this, OpenGL20Activity.class);
        intent.putExtra("path", path);
        startActivity(intent);
    }
}
